package com.company.prototype;


import java.util.ArrayList;
import java.util.List;

/**
 * 原型模式-浅拷贝
 */
public class CarByShallow implements Cloneable {

    //名称
    private String name;
    //车长
    private int length;
    //包含型号
    private List<String> modelList = new ArrayList<>();


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public List<String> getModelList() {
        return modelList;
    }

    public void setModelList(List<String> modelList) {
        this.modelList = modelList;
    }


    @Override
    public CarByShallow clone() throws CloneNotSupportedException {
        return (CarByShallow) super.clone();
    }

}
